Skip to content

Conversation

khromov
Copy link
Contributor

@khromov khromov commented Dec 10, 2024

Adds the following endpoints:

Listing:
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms.txt

Dedicated merged docs for Svelte/Kit/CLI:
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms-small.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/llms-full.txt

Package-specific docs:
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/svelte/llms.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/kit/llms.txt
https://svelte-dev-git-llms-txt-svelte.vercel.app/docs/cli/llms.txt

Suggested Advent of Svelte text

Day XX: LLM-friendly documentation

We've added new endpoints that make it easier for AI assistants to understand and work with Svelte documentation. These endpoints provide the documentation in a format that's optimized for Large Language Models, helping them give you more accurate and up-to-date answers about Svelte, SvelteKit, and the Svelte CLI.

General documentation

Abridged Svelte and SvelteKit documentation: https://svelte.dev/llms.txt
Full Svelte and SvelteKit documentation: https://svelte.dev/llms-full.txt

Package-specific documentation

Full Svelte documentation: https://svelte.dev/docs/svelte/llms.txt
Full SvelteKit documentation: https://svelte.dev/docs/kit/llms.txt
Full Svelte CLI documentation: https://svelte.dev/docs/cli/llms.txt

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.

Comment on lines 135 to 140
function getSectionPriority(path: string): number {
if (path.includes('/docs/svelte/')) return 0;
if (path.includes('/docs/kit/')) return 1;
if (path.includes('/docs/cli/')) return 2;
return 3;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to ensure ordering in the combined docs.

Comment on lines 154 to 158
if (dirA === dirB) {
if (a.endsWith('index.md')) return -1;
if (b.endsWith('index.md')) return 1;
return a.localeCompare(b);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to ensure that eg docs/svelte/01-introduction/index.md comes before docs/svelte/01-introduction/01-overview.md

Copy link

vercel bot commented Dec 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2024 11:29am

Comment on lines 9 to 39
ignore: [
// Svelte ignores
'../../../content/docs/svelte/07-misc/04-custom-elements.md',
'../../../content/docs/svelte/07-misc/06-v4-migration-guide.md',
'../../../content/docs/svelte/07-misc/07-v5-migration-guide.md',
'../../../content/docs/svelte/07-misc/99-faq.md',
'../../../content/docs/svelte/07-misc/xx-reactivity-indepth.md',
'../../../content/docs/svelte/98-reference/21-svelte-legacy.md',
'../../../content/docs/svelte/99-legacy/**/*.md',
'../../../content/docs/svelte/98-reference/30-runtime-errors.md',
'../../../content/docs/svelte/98-reference/30-runtime-warnings.md',
'../../../content/docs/svelte/98-reference/30-compiler-errors.md',
'../../../content/docs/svelte/98-reference/30-compiler-warnings.md',
'**/xx-*.md',
// SvelteKit ignores
'../../../content/docs/kit/25-build-and-deploy/*adapter-*.md',
'../../../content/docs/kit/25-build-and-deploy/99-writing-adapters.md',
'../../../content/docs/kit/30-advanced/70-packaging.md',
'../../../content/docs/kit/40-best-practices/05-performance.md',
'../../../content/docs/kit/60-appendix/**/*.md'
],
minimize: {
removeLegacy: true,
removeNoteBlocks: true,
removeDetailsBlocks: true,
removePlaygroundLinks: true,
removePrettierIgnore: true,
normalizeWhitespace: true
}
})}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep the default preset trimmed down in a way so that most use cases are covered but we still remove less important bits and bobs. For reference the trimmed llms.txt is 514KB as of today, and llms-full.txt (where nothing is omitted) is 843KB.

@Rich-Harris
Copy link
Member

Rich-Harris commented Dec 13, 2024

I've added some information to /docs, along with a new /docs/llms page. The latter could probably use some notes on how to use these files, but I'm not qualified to write them — if anyone else feels up to it, knock yourselves out. Am imagining something along these lines, if that makes sense

## Claude

lorem ipsum dolor sit amet how to use with Claude

## Cursor

lorem ipsum dolor sit amet how to use with Cursor

## v0

lorem ipsum dolor sit amet how to use with Cursor

## Bolt

lorem ipsum dolor sit amet how to use with Cursor

@Rich-Harris Rich-Harris merged commit 99b16ef into main Dec 13, 2024
4 checks passed
@Rich-Harris Rich-Harris deleted the llms-txt branch December 13, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants